package com.csw.shuanfa.CodeImprove.designPattern;


/**
 * 单例模式
 */
public class SingletonD {
    private static SingletonD instance = null;

    private SingletonD() {

    }

    /**
     * 静态方法，获取唯一实例
     *
     * @return
     */
    public static SingletonD getInstance() {
        if (instance == null) {
            instance = new SingletonD();
        }
        return instance;
    }
}
